package test.aat.ejinr.wo3g;

import test.aat.ejinr.chk.HttpRequest;

public class LianTongPhoneCheck {

	public static void main(String[] args) {
		//chkLTPhone("13000000000");
		//chkLTPhone("13001994248");
		System.out.println(chkLTPhone("", "", "13000000000"));
		System.out.println(chkLTPhone("", "", "13001994248"));
		System.out.println(chkLTPhone("106.249.176.213", "80", "13000000000"));
		System.out.println(chkLTPhone("106.249.176.213", "80", "13001994248"));
		
	}
	
	public static void chkLTPhone(String phone){
		String url="https://upay.10010.com/npfweb/NpfCellWeb/Mustpayment/getMustpayment";
		String param="number="+phone+"&GET";
		String res = HttpRequest.sendGet(url, param);
		System.out.println(res);
	}
	
	/**
	 * 
	 * @param ip  代理的IP地址
	 * @param port 代理的端口号
	 * @param phone 验证的手机号码
	 * @return long 数值，如果注册过的在100以上，未注册的在35左右，可以均值来进行判断；
	 */
	public static boolean chkLTPhone(String ip, String port, String phone) {
		if (null == ip || ip.length() == 0 || null == port || port.length() == 0) {

		} else {
			System.setProperty("http.maxRedirects", "50");
			System.getProperties().setProperty("proxySet", "true");
			System.getProperties().setProperty("http.proxyHost", ip);
			System.getProperties().setProperty("http.proxyPort", port);
		}
		
		String url="https://upay.10010.com/npfweb/NpfCellWeb/Mustpayment/getMustpayment";
		String param="number="+phone+"&GET";
		String res = HttpRequest.sendGet(url, param);
		
		if(res.contains("0.00")){
			return true;
		}
		return false;
	}
	

}
